package com.lvmama.client.dw;

import java.util.List;
import java.util.Map;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.lvmama.common.result.Result;
import com.lvmama.pojo.dto.dw.RepruchaseAnalysisQuery;
import com.lvmama.pojo.entity.dw.RepruchaseAnalysis;

/**
 * @Author:xuzhongwei
 * @Description:
 * @Date：2018/08/08
 */
@FeignClient("rhino-web-service")
@RequestMapping("${server.servlet.context-path}")
public interface RepurchaseClient {

    /**
     * 查询复购分析结果
     * @param query 查询条件
     * @return 结果集
     */
	@RequestMapping(method = RequestMethod.POST, value = "/repurchase/queryRepruchaseAnalysisList", consumes = "application/json")
	Result<List<RepruchaseAnalysis>> queryRepruchaseAnalysisList(@RequestBody RepruchaseAnalysisQuery query);

    /**
     * 查询最近一条记录
     * @return 最近一条记录
     */
	@RequestMapping(method = RequestMethod.GET, value = "/repurchase/selectLatestRecord", consumes = "application/json")
	Result<RepruchaseAnalysis> selectLatestRecord();

    /**
     * 获取复购率推送时间列表
     * @return 结果集
     */
	@RequestMapping(method = RequestMethod.GET, value = "/repurchase/getCreateTimeList", consumes = "application/json")
	Result<List<RepruchaseAnalysis>> getCreateTimeList();
	
	@RequestMapping(method = RequestMethod.POST, value = "/repurchase/getDistributionResult", consumes = "application/json")
	Result<Map<String, Object>> getDistributionResult(@RequestParam(value = "chooseTime") String chooseTime);
	
	@RequestMapping(method = RequestMethod.GET, value = "/repurchase/getAttributesResult", consumes = "application/json")
	Result<Map<String, Object>> getAttributesResult(@RequestParam(value = "chooseTime") String chooseTime);
}
